﻿<phone:PhoneApplicationPage 
    x:Class="Studentpartners.Sightseeing.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    d:DataContext="{d:DesignData /SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <shell:SystemTray.ProgressIndicator>
        <shell:ProgressIndicator x:Name="TrayBar" />
    </shell:SystemTray.ProgressIndicator>

        <!--LayoutRoot-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--TitlePanel-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Path=LocalizedResources.Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel-->
        <StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            
            <!--Maps Control-->
            <maps:Map x:Name="MapsControl" Margin="-12,0,-12,25" Height="200"
                      CredentialsProvider="ArDuYzAfQzv8AUX2cH5CuVqIM8n466pQVIGBkRwvySDuaZ4XYBiXSGYt_rMTxleb" />
            
            <!--Sight list-->
            <ListBox ItemsSource="{Binding Items}" Height="310">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Button Style="{StaticResource InvisibleButtonStyle}" Command="{Binding NavigateTo}">
                            <StackPanel Orientation="Horizontal" Margin="0,0,0,18">
                                <Button Content="{Binding Id}" BorderThickness="1" Margin="0,-15" Height="82" Width="70" Command="{Binding CenterMap}" />
                                <StackPanel Margin="-12,-10,0,0">
                                    <TextBlock Text="{Binding Title}" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding Short}" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </StackPanel>
                        </Button>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </StackPanel>
    </Grid>
    
    <!--ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBarIconButton IconUri="/Resources/appbar.map.centerme.rest.png" Text="Find Me" Click="FindMe_Click" />
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="Info" Click="AppBar_Info_Click" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>